package generatedClasses;

import struts.*;
import struts.tools.*;

public class PageCreator
{
  protected static String nl;
  public static synchronized PageCreator create(String lineSeparator)
  {
    nl = lineSeparator;
    PageCreator result = new PageCreator();
    nl = null;
    return result;
  }

  public final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
  protected final String TEXT_1 = "";
  protected final String TEXT_2 = "\" %>";
  protected final String TEXT_3 = NL;
  protected final String TEXT_4 = "\" %>";
  protected final String TEXT_5 = NL;
  protected final String TEXT_6 = " %>";
  protected final String TEXT_7 = NL;
  protected final String TEXT_8 = " %>";
  protected final String TEXT_9 = NL;
  protected final String TEXT_10 = " %>";
  protected final String TEXT_11 = NL + NL + "<html:html>" + NL + "\t<head>" + NL + "\t\t<title>" + NL + "\t\t<bean:message key=\"page.title.";
  protected final String TEXT_12 = "\"/>" + NL + "\t\t</title>" + NL + "\t\t" + NL + "\t</head> " + NL + "" + NL + "\t<body>" + NL + "\t";
  protected final String TEXT_13 = NL + "\t" + NL + "\t</body>" + NL + "</html:html>";
  protected final String TEXT_14 = NL;

  public String generate(Object argument)
  {
    final StringBuffer stringBuffer = new StringBuffer();
    stringBuffer.append(TEXT_1);
    stringBuffer.append( "<%@ page language=\"java\" contentType=\"text/html; charset=ISO-8859-1\" pageEncoding=\"ISO-8859-1\"");
    stringBuffer.append(TEXT_2);
    stringBuffer.append(TEXT_3);
    stringBuffer.append( "<%@ taglib prefix=\"html\" uri=\"http://struts.apache.org/tags-html\"" );
    stringBuffer.append(TEXT_4);
    stringBuffer.append(TEXT_5);
    stringBuffer.append( "<%@ taglib prefix=\"bean\" uri=\"http://struts.apache.org/tags-bean\"" );
    stringBuffer.append(TEXT_6);
    stringBuffer.append(TEXT_7);
    stringBuffer.append( "<%@ taglib prefix=\"logic\" uri=\"http://struts.apache.org/tags-logic\"" );
    stringBuffer.append(TEXT_8);
    stringBuffer.append(TEXT_9);
    stringBuffer.append( "<%@ taglib prefix=\"nested\" uri=\"http://struts.apache.org/tags-nested\"" );
    stringBuffer.append(TEXT_10);
     Data dataPage = (Data) argument;
    stringBuffer.append(TEXT_11);
    stringBuffer.append( dataPage.getPageTitle());
    stringBuffer.append(TEXT_12);
    stringBuffer.append(	dataPage.getJspCode());
    stringBuffer.append(TEXT_13);
    stringBuffer.append(TEXT_14);
    return stringBuffer.toString();
  }
}
